//
//  ShiPei.m
//  KuangJia
//
//  Created by cooper on 15/11/6.
//  Copyright © 2015年 cooper. All rights reserved.
//

#import "ShiPei.h"
#import "AppDelegate.h"
@implementation ShiPei
+ (CGRect)CGRectMakeScale:(CGFloat)x :(CGFloat)y :(CGFloat) width :(CGFloat) height
{
    AppDelegate *myDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    CGRect rect;
    rect.origin.x = x * myDelegate.autoSizeScaleX;
    rect.origin.y = y * myDelegate.autoSizeScaleY;
    rect.size.width = width * myDelegate.autoSizeScaleX;
    rect.size.height = height * myDelegate.autoSizeScaleY;
    return rect;
}

+ (CGSize)CGSizeMakeScale:(CGFloat)width : (CGFloat) height
{
    AppDelegate *myDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    CGSize size;
    
    size.width = width * myDelegate.autoSizeScaleX;
    size.height = height * myDelegate.autoSizeScaleY;
    return size;
}
+ (CGPoint)CGPointMakeScale:(CGFloat) x :(CGFloat)y
{
    AppDelegate * myDelegate =(AppDelegate *)[[UIApplication sharedApplication]delegate];
    CGPoint point = CGPointMake(x*myDelegate.autoSizeScaleX, y*myDelegate.autoSizeScaleY);
    return point;
}

+ (CGFloat)CGFloatMakeScale:(CGFloat) x
{
    AppDelegate * myDelegate =(AppDelegate *)[[UIApplication sharedApplication]delegate];
    CGFloat point = x*myDelegate.autoSizeScaleX;
    return point;
}

+ (CGFloat)CGFloatMakeFontScaleWithPX:(CGFloat) x{
    AppDelegate * myDelegate =(AppDelegate *)[[UIApplication sharedApplication]delegate];
    CGFloat point = (x/2)*myDelegate.autoSizeScaleX;
    return point;
}
@end
